package com.zyj.java1;

/**
 * @program: JVMDemo
 * @ClassName Memory
 * @author: YaJun
 * @Date: 2021 - 12 - 27 - 11:51
 * @Package: com.zyj.java1
 * @Description:
 */
public class Memory {

    public static void main(String[] args) {
        int i = 1;
        Object obj = new Object();
        Memory mem = new Memory();
//        mem.foo(obj);
        String str = new String("abc");
        mem.foo(str);
    }

    private void foo(String param) {
        String str = param.toString();
        String intern = str.intern();
        String s = "abc";
        System.out.println(str == s);
        System.out.println(s == intern);
        System.out.println(str);
    }
}
